import request from '@/utils/request'

import qs from 'qs';

export function createTeacher(data) {
  return request({
    url:'/teacher/register',
    method:'post',
    data:data
  })
}

export function getTeacher(id) {
  return request({
    url:'/teacher/getTeacherById/'+id,
    method:'get'

  })

}
export function updateTeacher(data) {
  return request({
    url:'/teacher/update',
    method:'post',
    data:data
  })

}

export function fetchList(param) {
  return request({
    url:'/teacher/list',
    method:'get',
    params: param
  })

}

export function getRoleByTeacherId(id) {
  return request({
    url:'/teacher/getRolesByTeacherId/'+id,
    method:'get'
  })
}
export function updateRole(params){
  return request({
    url:'/teacher/role/update',
    method:'post',
    data:qs.stringify(params, { arrayFormat: 'repeat' })
  })
}




